import request from '@/network'

// 1. 文章评论
// 文章评论列表
export const queryArticleCommentList = async (currentPage: number = 1, pageSize: number = 7) => {
  const result = await request.get({
    url: '/comment/article/list',
    params: {
      currentPage,
      pageSize,
    },
  })
  return result
}
// 文章评论搜索
export const searchArticleCommentRequest = async (searchInfo: { [key: string]: any }, currentPage: number = 1, pageSize: number = 7) => {
  const result = await request.post({
    url: '/comment/article/search',
    data: {
      searchInfo,
      currentPage,
      pageSize,
    },
  })
  return result
}
// 删除评论
export const deleteArticleCommentRequest = async (comment_id: number) => {
  const result = await request.delete({
    url: '/comment/article/delete_comment',
    data: {
      comment_id,
    },
  })
  return result
}

// 2. 说说评论
export const queryMessageCommentRequest = async (currentPage: number = 1, pageSize: number = 7) => {
  const result = await request.get({
    url: '/comment/message/list',
    params: {
      currentPage,
      pageSize,
    },
  })
  return result
}
// 文章评论搜索
export const searchMessageCommentRequest = async (searchInfo: { [key: string]: any }, currentPage: number = 1, pageSize: number = 7) => {
  const result = await request.post({
    url: '/comment/message/search',
    data: {
      searchInfo,
      currentPage,
      pageSize,
    },
  })
  return result
}
// 删除说说评论
export const deleteMessageCommentRequest = async (id: number) => {
  const result = await request.delete({
    url: '/comment/message/delete',
    data: {
      id,
    },
  })
  return result
}
